#!/usr/bin/env python
# -*- coding:UTF-8 -*-
# Project: blog
#  Author: an00
#  Create: 2018/4/12 20:20


from django.contrib.syndication.views import Feed
from blog.models import Article


class AllArticleRssFeed(Feed):
    title = "an00的博客"
    link = "/"
    description = "an00博客中的文章"

    def items(self):
        return Article.objects.all().filter(status=0)

    def item_title(self, item):
        return '[{}] {}'.format(item.category, item.title)

    def item_description(self, item):
        return item.body
